/**
 * 
 */
package cn.gov.msa.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;

import cn.gov.msa.dao.QuestionsMapper;
import cn.gov.msa.model.Questions;
import cn.gov.msa.pagehelper.CustomPageHelper;
import cn.gov.msa.service.QuestionsService;

/**
 * @author Administrator
 *
 */
public class QuestionsServiceImpl implements QuestionsService {

	@Autowired
	private QuestionsMapper questionsMapper;
	
	@Override
	public List<Questions> selectData(int pageNum, int pageSize, Questions questions) {
		CustomPageHelper.startPage(pageNum, pageSize); // 核心分页代码 		
		return questionsMapper.selectData(questions);
	}
	
	@Override
	@Transactional
	public int update(Questions questions) {
		return questionsMapper.updateByPrimaryKeySelective(questions);
	}

	@Override
	@Transactional
	public int insert(Questions questions) {
		return questionsMapper.insert(questions);
	}

	@Override
	@Transactional
	public int delete(String questionsId) {
		return questionsMapper.delete(questionsId);
	}

	@Override
	public int deleteByMsgId(String msgId) {
		return questionsMapper.deleteByMsgId(msgId);
	}

}
